package com.ruoyi.db.model.param;

import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import lombok.Data;

@Data
public class BaseParam {

    public String startCreateTime;

    public String endCreateTime;

    public String createTime;

    public String getStartCreateTime(){
        if (StrUtil.isNotEmpty(createTime) && StrUtil.isEmpty(startCreateTime)){
            String[] split = createTime.split("~");
            this.startCreateTime = split[0];
            return startCreateTime;
        }
        return startCreateTime;
    }

    public String getEndCreateTime(){
        if (StrUtil.isNotEmpty(createTime) && StrUtil.isEmpty(endCreateTime)){
            String[] split = createTime.split("~");
            this.endCreateTime = split[1];
            return endCreateTime;
        }
        return endCreateTime;
    }

    public String startDateInfo;

    public String endDateInfo;

    public String dateInfo;

    public String getStartDateInfo(){
        if (StrUtil.isNotEmpty(dateInfo) && StrUtil.isEmpty(startDateInfo)){
            String[] split = dateInfo.split(" ~ ");
            this.startDateInfo = split[0];
            return startDateInfo;
        }
        return startDateInfo;
    }

    public String getEndDateInfo(){
        if (StrUtil.isNotEmpty(dateInfo) && StrUtil.isEmpty(endDateInfo)){
            String[] split = dateInfo.split(" ~ ");
            this.endDateInfo = split[1];
            return endDateInfo;
        }
        return endDateInfo;
    }

}
